﻿using System.Collections.Generic;
using System.Threading.Tasks;
using SelfService.Model.Models;
using SelfService.Model.ViewModels;

namespace SelfService.Model.Interface
{
    public interface IHisUser
    {
        /// <summary>
        /// 查询用户HIS建档信息
        /// </summary>
        /// <param name="patient"></param>
        /// <param name="client">客户端信息</param>
        /// <param name="operator">操作员信息</param>
        /// <returns>
        /// Code = 200 查询成功, 返回建档信息
        /// Code = 2 查询成功, 用户未建档
        /// Code = 1 未知错误
        /// Message返回详细错误信息
        /// </returns>
        public Task<ResultDetail<IPatient>> GetUser(IPatient patient, SysClient client, SysOperator @operator);

        /// <summary>
        /// 查询用户HIS建档信息
        /// </summary>
        /// <param name="search"></param>
        /// <returns>
        /// Code = 200 查询成功, 返回建档信息
        /// Code = 2 查询成功, 用户未建档
        /// Code = 1 未知错误
        /// Message返回详细错误信息
        /// </returns>
        public Task<ResultDetail<IPatient>> GetUser(SysPatientSearcher search);


        public Task<ResultDetail<IPatient>> Reg(IPatient patient);

        /// <summary>
        /// 通过ECode换取CardNo
        /// </summary>
        /// <param name="code"></param>
        /// <param name="client"></param>
        /// <param name="operator"></param>
        /// <returns></returns>
        public Task<ResultDetail<IPatient>> GetUserByECode(string code, SysClient client, SysOperator @operator);
    }


    public interface IHisOrder
    {
        /// <summary>
        /// 查询缴费列表
        /// </summary>
        /// <param name="patient"></param>
        /// <returns></returns>
        public Task<ResultDetail<List<IOrder>>> GetOrderList(IPatient patient);
        

        /// <summary>
        /// 缴费
        /// </summary>
        /// <param name="order">缴费信息</param>
        /// <param name="pay">支付信息</param>
        /// <returns></returns>
        public Task<ResultDetail<bool>> Pay(IOrder order, SysPay pay);


        /// <summary>
        /// 充值
        /// </summary>
        /// <param name="pay"></param>
        /// <param name="patient"></param>
        /// <returns></returns>
        public Task<ResultDetail<bool>> AddCredit(SysPay pay, IPatient patient);


        /// <summary>
        /// 创建就诊号
        /// </summary>
        /// <param name="patient"></param>
        /// <returns></returns>
        public Task<ResultDetail<string>> CreateTreatmentNo(IPatient patient);

        /// <summary>
        /// 获取收费项目列表
        /// </summary>
        /// <returns></returns>
        public Task<ResultDetail<SysMedicalProject[]>> GetProjectList();

        /// <summary>
        /// 生成缴费单, 自动生成就诊流水号
        /// </summary>
        /// <param name="patient">患者</param>
        /// <param name="projectNo">项目编号</param>
        /// <param name="qty"></param>
        /// <returns></returns>
        public Task<ResultDetail<IOrder>> CreateOrder(IPatient patient, string projectNo, int qty);

        /// <summary>
        /// 退款
        /// </summary>
        /// <param name="prescription"></param>
        /// <returns></returns>
        public Task<ResultDetail<bool>> Refund(SysPrescription prescription);
    }













}
